<template>
    <div class="top-detial">
        <div class="top-header">
            <van-nav-bar title="专题详情" left-text="返回" left-arrow @click-left="$router.back()" fixed />
            <div class="top-content" v-html="topdetiallist.content"></div>
            <div class="top-bottom">
                <div class="bottom-title">专题推荐</div>
                <div class="bottom-content" v-for="item in toprecommendList " :key="item.id">
                    <div class="content-top">
                        <img :src="item.scene_pic_url" alt="" class="content-top-img">
                    </div>
                    <div class="content-bottom">{{ item.title }}</div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { useRoute } from 'vue-router';
import { gettopicDataApi } from '@/api/detail'
import { onMounted } from 'vue';
const route = useRoute()
const topdetiallist = ref<detialNs.Idetialtop>({ content: '' })
const toprecommendList =ref<detialNs.Irecommdetialdata[]>([])
const gettoplistHandler = async () => {
    let res = await gettopicDataApi(route.query.id as string)
    topdetiallist.value = res.data
    toprecommendList.value =res.recommendList
}
onMounted(() => {
    gettoplistHandler()
})
</script>

<style scoped lang="scss">
.top-detial {
    .top-header {
        height: 45px;
    }

    .top-content {
        width: 100%;
        display: flex;
        flex-direction: column;
    }
    .top-bottom{
        .bottom-title{
            text-align: center;
            height: 0.76rem;
            line-height: 0.76rem;
            font-size: 19px;
            color: #333333;
        }
        .bottom-content{
            .content-top{
                width: 3.55rem;
                height: 1.71rem;
                margin: 0 auto;
                .content-top-img{
                    width: 100%;
                    height: 100%;
                }
            }
            .content-bottom{
                width: 3.40rem;
                height: 0.63rem;
                margin: 10px  auto  5px;
                background: #fff;
                line-height: 0.63rem;
                color: #333333;
                font-size: 15px;
                padding-left: 15px;
            }
        }
    }
}
</style>